#include "text_box.h"


void text_box::assign(wxWindow *parent,
               wxWindowID id,
               const wxString& value,
               const wxPoint& pos,
               const wxSize& size,
               long style,
               const wxString& name,
               const wxValidator& validator)
{
	m_tb = new wxTextCtrl( parent, id, value, pos, size, style, validator, name );
	wxPoint tP = pos;
	m_text = new wxStaticText(parent, -1, name, tP);
	tP.x -= m_text->GetClientRect().GetWidth() + 3;
	tP.y += 2;
	m_text->SetPosition(tP);
}

void text_box::set_text(const wxString& t)
{
	m_tb->SetValue(t);
}

void text_box::Show(bool ch)
{
	m_tb->Show(ch);
	m_text->Show(ch);
}